﻿module Search_tests
open Xunit
open FSharpChess
//simple stalemate checks
[<Fact>]
let test_simple_stalemate8() = 
    Psn_tests.setup_pos8()
    Funcs.gm.SetMaterialCount() 
    let cond=not (Search_full.simple_stalemate Funcs.gm)
    let mess="should not be stalemate"
    Assert.True(cond,mess)
[<Fact>]
let test_simple_stalemate9() = 
    Psn_tests.setup_pos9() 
    Funcs.gm.SetMaterialCount()
    let cond=Search_full.simple_stalemate Funcs.gm
    let mess="should be stalemate"
    Assert.True(cond,mess)
[<Fact>]
let test_capture_is_dangerous3() =
    Psn_tests.setup_pos3()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 2, 13, 6, 16, 0)
    let cond = not (Search_full.capture_is_dangerous mv Funcs.gm)
    let mess = "this caputure should not be"
    Assert.True(cond,mess)
[<Fact>]
let test_capture_is_dangerous10() =
    Psn_tests.setup_pos10()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 8, 40, 48, -1, 0)
    let cond = Search_full.capture_is_dangerous mv Funcs.gm
    let mess = "this caputure should be"
    Assert.True(cond,mess)
[<Fact>]
let test_capture_is_dangerous11() =
    Psn_tests.setup_pos11()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 8, 33, 40, 19, 0)
    let cond = Search_full.capture_is_dangerous mv Funcs.gm
    let mess = "this caputure should be"
    Assert.True(cond,mess)
[<Fact>]
let test_capture_is_dangerous12() =
    Psn_tests.setup_pos12()
    Funcs.gm.SetMaterialCount()
    let mv = Funcs.gm.CreateMove(Standard, 19, 40, 48, 8, 0)
    let cond = Search_full.capture_is_dangerous mv Funcs.gm
    let mess = "this caputure should be"
    Assert.True(cond,mess)

